package Test_0907;

/**
 * Created with Intellij IDEA
 * Description:
 * User: 星辰
 * Dare: 2024-09-14
 * Time: 19:35
 */
public class Test_0907 {

    public static void main2(String[] args) {
        String s1="lisi";
        String s2=new String("zhang");
        //比较大小
        System.out.println(s1.compareTo(s2));
        //忽略大小写比较
        System.out.println(s1.compareToIgnoreCase(s2));
    }
    public static void main1(String[] args) {
        String s1="lisi";
        String s2=new String("lisi");
        char [] value={'a','b','c'};
        String s3=new String(value);
        s1=s3;
        System.out.println(s1);
        System.out.println(s3);
        //比较地址
        System.out.println(s1==s2);
        System.out.println(s1==s3);
        //比较内容
        System.out.println(s1.equals(s2));
        System.out.println(s1.equals(s3));
    }
}
